class Task implements Comparable{
  static mapping = {
    table 'yuying_task'
    content type:"text" 
  }
  public static Integer TASK_TYPE_SHOULD_DO = 0
  public static Integer TASK_TYPE_SHOULD_CARE = 1

  public static Integer TASK_STATUS_NOT_READ = 0
  public static Integer TASK_STATUS_READED = 1
  public static Integer TASK_STATUS_DONE = 2
  Baby baby
  String title
  String content
  Long planId
  Integer taskType
  Integer status
  Integer reminded
  Date dateCreated
  Date dateActive
  Date dateUpdate
  static constraints = {
    planId(nullable: true)
    content(nullable: true)
    reminded(nullable: true)
    dateUpdate(nullable: true)
  }


  public int compareTo(Object o) {
    if(status == o.status)  {
      return  dateActive.compareTo(o.dateActive)
    } else {
      return  status.compareTo(o.status)
    }
  }
}
